package com.amqr.movetest.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.LinearLayout;

/**
 * User: LJM
 * Date&Time: 2017-05-25 & 12:25
 * Describe: Describe Text
 */
public class InterceptLinearLayout extends LinearLayout {


    private boolean isIntercept = false;

    public InterceptLinearLayout(Context context) {
        super(context);
    }

    public InterceptLinearLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public InterceptLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if(isIntercept){
            return true;
        }else{
            return false;
        }

        //return super.onInterceptTouchEvent(ev);
    }


    public void setIntercept(boolean intercept) {
        isIntercept = intercept;
    }
}
